import {UserActions} from './user';

const initialState = {};

export const ForgetActions = {
  FORGET_FORM_UPDATE: 'forget_form_update',
  FORGET_FORM_RESET: 'forget_form_reset',
};

export function updateForgetForm(payload) {
  return {
    type: ForgetActions.FORGET_FORM_UPDATE,
    payload,
  };
}

export function resetForgetForm() {
  return {
    type: ForgetActions.FORGET_FORM_RESET,
  };
}

export default function forgetForm(state = initialState, action) {
  switch (action.type) {
    case ForgetActions.FORGET_FORM_UPDATE:
      return {...state, ...action.payload};
    case ForgetActions.FORGET_FORM_RESET:
      return {};
    case UserActions.USER_SIGN_OUT:
      return {};
    default:
      return state;
  }
}
